﻿using System;
using CellarDoor.Gui.Elements;

namespace CellarDoor.Gui
{
    public class UiNavigateNode
    {
        /// <summary>
        /// Gets and sets the element to the left on the navigation path
        /// </summary>
        public UiNavigateNode Left { get; set; }

        /// <summary>
        /// Gets and sets the element to the right on the navigation path
        /// </summary>
        public UiNavigateNode Right { get; set; }

        /// <summary>
        /// Gets and sets the element to the top on the navigation path
        /// </summary>
        public UiNavigateNode Up { get; set; }

        /// <summary>
        /// Gets and sets the element to the bottom on the navigation path
        /// </summary>
        public UiNavigateNode Down { get; set; }

        /// <summary>
        /// Gets the wrapped <see cref="UiElement"/>
        /// </summary>
        public UiElement Element { get; private set; }

        /// <summary>
        /// Gets and sets a user defined object
        /// </summary>
        public object Tag { get; set; }

        /// <summary>
        /// Creates a new navigation node
        /// </summary>
        /// <param name="element"></param>
        public UiNavigateNode(UiElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            Element = element;
        }
    }
}
